﻿using System;

namespace Program16
{
    class Program
    {
        //定义一个委托
        public delegate void SayHi(string name);

        static void Main(string[] args)
        {
            Hello("张三", SayhiChinese);
            Hello("Justin", SayhiEnglish);
        }
        //委托参数调用方法名
        public static void Hello(string name,SayHi delegetSayhi)
        {
            delegetSayhi(name);
        }
        public static void SayhiChinese(string name)
        {
            Console.WriteLine("你好！{0}",name);
        }
        public static void SayhiEnglish(string name)
        {
            Console.WriteLine("Hello！{0}",name);
        }
    }
}
